/**
@author		Jong Min, Lee
@date		  01/21/2014
@breif		main application global instance set

copyright(c) Tae Young Soft. All right reserved. 2014
*/
#include "stdafx.h"
#include "Taurus/AppGlobalInstanceSet.h"

#include "Taurus_Worklist/ToyWorklist.h"
#include "Taurus_Viewer/Viewer.h"
#include "Taurus_Common/MonitorAdmin.h"
#include "Taurus_Common/SystemEnvironment.h"
#include "Taurus_Util/Macros.h"

CAppGlobalInstanceSet* CAppGlobalInstanceSet::m_pInstance = NULL;

CAppGlobalInstanceSet::CAppGlobalInstanceSet()
  : m_pWorklist(NULL), m_pViewer(NULL)
{}

CAppGlobalInstanceSet::~CAppGlobalInstanceSet()
{
}

CAppGlobalInstanceSet* CAppGlobalInstanceSet::getInstance()
{
  if(m_pInstance == NULL)
    _TRY_ALLOC(m_pInstance, CAppGlobalInstanceSet);

  return m_pInstance;
}

IWorklistModule* CAppGlobalInstanceSet::getWorklist()
{
  if(m_pWorklist == NULL)
    _TRY_ALLOC(m_pWorklist, CToyWorklist) 
  return m_pWorklist;
}

IViewerModule* CAppGlobalInstanceSet::getViewer()
{
  if(m_pViewer == NULL)
    _TRY_ALLOC(m_pViewer, CViewer);

  return m_pViewer;
}

CMonitorAdmin* CAppGlobalInstanceSet::getMonitorAdmin()
{
  return CMonitorAdmin::getInstance();
}

CSystemEnvironment* CAppGlobalInstanceSet::getSystemEnvironment()
{
  return CSystemEnvironment::getInstance();
}